package com.ssy.lingxi.member.merchant.controller.web;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.lifecycle.request.*;
import com.ssy.lingxi.member.merchant.model.vo.lifecycle.response.*;
import com.ssy.lingxi.member.merchant.service.web.IMemberRectifyService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @menu 会员能力 - 会员整改
 * @author yzc
 * @version 2.0.0
 * @date 2021/5/18
 */
@RestController
@RequestMapping("/member/rectify")
public class MemberRectifyController {

    @Resource
    private IMemberRectifyService memberRectifyService;

    /**
     * 会员整改查询 - 外部状态下拉查询(上级会员)
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/statusList", method = RequestMethod.GET)
    public Wrapper<List<StatusVO>> listMemberRectifyOuterStatus(@RequestHeader HttpHeaders headers) {
        return memberRectifyService.listMemberRectifyOuterStatus(headers);
    }

    /**
     * 会员信息查询 - 外部状态下拉查询(下级会员)
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/manage/statusList", method = RequestMethod.GET)
    public Wrapper<List<StatusVO>> listSubMemberRectifyOuterStatus(@RequestHeader HttpHeaders headers) {
        return memberRectifyService.listSubMemberRectifyOuterStatus(headers);
    }

    // ==================================会员整改查询==================================

    /**
     * 会员整改查询 - 会员整改分页列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/summary/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberRectifySummaryPageQueryVO>> pageMemberRectify(@RequestHeader HttpHeaders headers, @Valid MemberAddRectifySummaryPageVO queryVO) {
        return memberRectifyService.pageSummaryMemberRectify(headers, queryVO);
    }

    /**
     * 会员整改查询 - 会员整改详情
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/summary/get", method = RequestMethod.GET)
    public Wrapper<MemberRectifyResultVO> getMemberRectifyResult(@RequestHeader HttpHeaders headers, @Valid CommonIdVO idVO) {
        return memberRectifyService.getMemberRectifyResult(headers, idVO);
    }


    // ==================================待新增整改通知单==================================

    /**
     * 待新增整改通知单 - 会员整改分页列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/waitAdd/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberRectifyAddPageQueryVO>> pageWaitAddMemberRectify(@RequestHeader HttpHeaders headers, @Valid MemberAddRectifyPageVO queryVO) {
        return memberRectifyService.pageAddMemberRectify(headers, queryVO);
    }

    /**
     * 待新增整改通知单 - 会员整改详情
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/waitAdd/get", method = RequestMethod.GET)
    public Wrapper<MemberRectifyVO> getMemberRectify(@RequestHeader HttpHeaders headers, @Valid CommonIdVO idVO) {
        return memberRectifyService.getMemberRectify(headers, idVO);
    }

    /**
     * 待确认整改结果 - 会员整改新增
     * @param headers Http头部信息
     * @param addVO 接口参数
     */
    @RequestMapping(value = "/waitAdd/add", method = RequestMethod.POST)
    public Wrapper<Void> addMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid MemberRectifyAddVO addVO) {
        return memberRectifyService.addMemberRectify(headers, addVO);
    }

    /**
     * 待确认整改结果 - 会员整改修改
     * @param headers Http头部信息
     * @param addVO 接口参数
     */
    @RequestMapping(value = "/waitAdd/update", method = RequestMethod.POST)
    public Wrapper<Void> updateMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid MemberRectifyUpdateVO addVO) {
        return memberRectifyService.updateMemberRectify(headers, addVO);
    }

    /**
     * 待确认整改结果 - 会员整改删除
     * @param headers Http头部信息
     * @param idVO 接口参数
     */
    @RequestMapping(value = "/waitAdd/delete", method = RequestMethod.POST)
    public Wrapper<Void> addMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid CommonIdVO idVO) {
        return memberRectifyService.deleteMemberRectify(headers, idVO);
    }

    /**
     * 待确认整改结果 - 发送
     * @param headers Http头部信息
     * @param idVO 接口参数
     */
    @RequestMapping(value = "/waitAdd/send", method = RequestMethod.POST)
    public Wrapper<Void> sendMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid CommonIdVO idVO) {
        return memberRectifyService.sendMemberRectify(headers, idVO);
    }

    // ==================================待确认整改结果==================================

    /**
     * 待确认整改结果 - 会员整改分页列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/waitConfirm/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberRectifyConfirmPageQueryVO>> pageWaitConfirmMemberRectify(@RequestHeader HttpHeaders headers, @Valid MemberAddRectifyPageVO queryVO) {
        return memberRectifyService.pageConfirmMemberRectify(headers, queryVO);
    }

    /**
     * 待确认整改结果 - 会员整改详情
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/waitConfirm/get", method = RequestMethod.GET)
    public Wrapper<MemberRectifyResultVO> getConfirmMemberRectify(@RequestHeader HttpHeaders headers, @Valid CommonIdVO idVO) {
        return memberRectifyService.getMemberRectifyResult(headers, idVO);
    }


    /**
     * 待确认整改结果 - 确认
     * @param headers Http头部信息
     * @param agreeVO 接口参数
     */
    @RequestMapping(value = "/waitConfirm/confirm", method = RequestMethod.POST)
    public Wrapper<Void> confirmMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid CommonAgreeVO agreeVO) {
        return memberRectifyService.confirmMemberRectify(headers, agreeVO);
    }

    // ==================================会员整改管理==================================

    /**
     * 会员整改管理 - 会员整改分页列表
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/manage/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberRectifyManagePageQueryVO>> pageManageMemberRectify(@RequestHeader HttpHeaders headers, @Valid MemberAddRectifySummaryPageVO queryVO) {
        return memberRectifyService.pageManageMemberRectify(headers, queryVO);
    }

    /**
     * 待新增整改通知单 - 会员整改详情
     * @param headers Http头部信息
     * @return 查询结果
     */
    @RequestMapping(value = "/manage/get", method = RequestMethod.GET)
    public Wrapper<MemberRectifyManageVO> getManageMemberRectify(@RequestHeader HttpHeaders headers, @Valid CommonIdVO idVO) {
        return memberRectifyService.getMemberRectifyManage(headers, idVO);
    }


    /**
     * 会员整改管理 - 进行整改
     * @param headers Http头部信息
     * @param reportVO 接口参数
     */
    @RequestMapping(value = "/manage/updateReport", method = RequestMethod.POST)
    public Wrapper<Void> updateReportMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid MemberRectifyReportVO reportVO) {
        return memberRectifyService.updateReportMemberRectify(headers, reportVO);
    }

    /**
     * 会员整改管理 - 提交整改
     * @param headers Http头部信息
     * @param idVO 接口参数
     */
    @RequestMapping(value = "/manage/rectify", method = RequestMethod.POST)
    public Wrapper<Void> rectifyMemberRectify(@RequestHeader HttpHeaders headers, @RequestBody @Valid CommonIdVO idVO) {
        return memberRectifyService.rectifyMemberRectify(headers, idVO);
    }
}
